package com.dm.utils;

/**
 * @Author DongJunJun
 * @Date 2022/9/6 20:56
 */
public class ResponseApi {

    private static  String success="true";
    private static String fail="false";
    private static  String errorCode="0000";

    public static <T> Result<T> setSuccess(){
        return  new Result<>(success,errorCode);
    }

    public static <T> Result<T> setSuccess(String message){
        return  new Result<>(success,errorCode,message);
    }
    public static <T> Result<T> setSuccess(T data){
        return  new Result<>(success,errorCode,data);
    }
    public static <T> Result<T> setSuccess(String message,T data){
        return  new Result<>(success,errorCode,message,data);
    }

    /**
     * 失败的情况
     * @param errorCode
     * @param message
     * @param <T>
     * @return
     */
    public static <T> Result<T> setFail(String errorCode,String message){
         return  new Result<>(fail,errorCode,message);
    }

}
